shader06.c
#version 460
#pragma vp_name REX Engine - Init Model Space
#pragma vp_function oe_rex_init_model, vertex_model, first
#define VP_STAGE_VERTEX
// uniforms
uniform vec4 oe_terrain_color;
uniform vec4 oe_tile_key_u;
// outputs
vec4 vp_Color;
#pragma vp_varying_out vec4 vp_Color
vec4 oe_layer_tilec;
#pragma vp_varying_out vec4 oe_layer_tilec
vec4 oe_terrain_tessLevel;
#pragma vp_varying_out vec4 oe_terrain_tessLevel
float oe_rex_morphFactor;
#pragma vp_varying_out float oe_rex_morphFactor
int oe_terrain_vertexMarker;
#pragma vp_varying_out flat int oe_terrain_vertexMarker
// stage globals
vec4 oe_tile_key;
void oe_rex_init_model(inout vec4 vertexModel)
{
    // Texture coordinate for the tile (always 0..1)
    oe_layer_tilec = gl_MultiTexCoord0;
    // Extract the vertex type marker
    oe_terrain_vertexMarker = int(oe_layer_tilec.z);
    // Color of the underlying map geometry (untextured)
    vp_Color = oe_terrain_color;
    // initialize:
    oe_rex_morphFactor = 0.0;
    // tile key
    oe_tile_key = oe_tile_key_u;
    
    // Default tessellation level (where applicable)
    oe_terrain_tessLevel = vec4(1);
}
